 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crystal.Libs;
using Microsoft.Xna.Framework;
using Ivory;
using Microsoft.Xna.Framework.Input;

namespace Crystal.Libs
{
    public sealed class RenderTestCamera : Camera
    {
        //Fields

        //cTor
        public RenderTestCamera(Game game) 
            : base(game, new Vector3(0, 10, -10), Vector3.Zero)
        {

        }

        //Methods
        public override void UpdateCamera(InputControl input, GameTime time)
        {
            Vector3 moveDir = Vector3.Zero;
            
            if(input.IsKeyDown(Keys.W))
              moveDir.Z += 1;
            else if(input.IsKeyDown(Keys.S))
              moveDir.Z -= 1;
              
            if(input.IsKeyDown(Keys.A))
              moveDir.X += 1;
            else if(input.IsKeyDown(Keys.D))
              moveDir.X -= 1;
              
            if(input.IsKeyDown(Keys.PageUp))
              moveDir.Y += 1;
            else if(input.IsKeyDown(Keys.PageDown))
              moveDir.Y -= 1;   
              
            if(moveDir != Vector3.Zero)
            {
                //Do somthing :P
                CameraPosition += moveDir;
                CameraLookAt += moveDir;
            }
        }
    }
}
